package com.tangxz.generate_code.example;

import java.sql.*;


public class DataBaseMain {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
        Class.forName("com.mysql.jdbc.Driver");
        Connection connection = DriverManager.getConnection("jdbc:mysql://localhost","root","5516");
        Statement statement = connection.createStatement();
        ResultSet rs = statement.executeQuery("show databases");
        rs.first();
        for (int i = 0; i < rs.getRow(); i++) {
            System.out.println(rs.getString(1));
            rs.next();
        }
    }
}
